/*
 * Created on Mar 8, 2004
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.recruiter.job;

/**
 * @author mmoore
 */
import java.util.Collection;
import java.util.List;
import java.util.Set;

import org.vectrics.company.Company;
import org.vectrics.company.SalaryType;
import org.vectrics.domain.Domain;
import org.vectrics.recruiter.user.CandidateInfo;
import org.vectrics.recruiter.user.Interview;
import org.vectrics.user.Person;

abstract public class JobProvider {
	
	public static final String BEAN_ID = "job.service";
	
	public JobProvider() {
		super();
	}
	
	abstract public JobPayType findJobPayType(String code);
	abstract public SalaryType findJobSalaryType(String code);
	abstract public Collection findAllJobPayTypes();
	abstract public Collection findAllJobSalaryTypes();
	abstract public String findNextJobReferenceCode(Domain domain, Job job);
	abstract public Job createJob(String title, JobFunction function, Person authPerson, Company company);
    abstract public Collection findAllJobStatusTypes(Domain domain);
    abstract public Job findJob(Long jobId);
	abstract public Collection findStatusReasonTypes(Domain domain, String fromStatusCode, String toStatusCode);
	abstract public JobStatusReasonType findDefaultStatusReason(Domain domain, String fromStatusCode, String toStatusCode);
	abstract public Collection findTransitionStatusTypes(Domain domain, Job job, String fromStatusCode);
	
	abstract public List findJobs(JobSearchCriteria criteria, int startIndex, int endIndex);
	abstract public int findJobCount(JobSearchCriteria criteria);
	abstract public Job findJobWithRefCode(Domain domain, String refCode);
	abstract public Job findCreateJobWithRefCode(Domain domain, String refCode, Person authPerson);
	abstract public void updateJob(Job job);
	abstract public void updateJobCandidate(JobCandidate job);
	abstract public Collection findJobSearchWords(Long jobId);
	abstract public JobCandidate findJobCandidateById(Long jobCandidateId);
	abstract public void removeJobCandidate(Long jobCandidateId);
	//abstract public List findJobsSortedByPostDate(int firstIndex, int pageSize);
	abstract public List findAllJobIds();
	abstract public List<Job> findJobs(); 
	abstract public List findFeaturedJobs(Set domains);
	abstract public List<JobFunction> findAllJobFunctions();
	abstract public List<JobFunction> findAllJobFunctionsForEvaluations();
	/**
	 * 
	 * @return Listado de los JobFunctionType
	 */
	abstract public List<JobFunctionType> findAllJobFunctionsType();
	abstract public JobFunctionType findAllJobFunctionsTypeById(Integer id);
	abstract public void updateJobFunction(JobFunction function);
	abstract public JobFunction findFunction(String functionCode);
	abstract public void resetJobPostDate(Job job);
	abstract public void removeAllJobs();
	abstract public List findJobCandidates(JobCandidateCriteria criteria, int startIndex, int endIndex);
	abstract public int findJobCandidatesCount(JobCandidateCriteria criteria);
	abstract public List findJobCandidateInterviews(JobCandidate jobCand);
	abstract public JobCandidateStatusType findJobCandidateStatusType(String statusTypeCode);
	abstract public Collection findJobCandidateStatusTypesTo(String fromStatusCode);
    abstract public Collection findAllJobCandidateStatusTypes();
    abstract public List findCandidates(CandidateScanCriteria candidateCriteria, int beginIndex, int endIndex);
    abstract public void updateJobCandidateStatus(JobCandidateStatus status);
    abstract public JobCandidateStatusReasonType findJobCandidateStatusReasonType(String code);
	abstract public boolean isJobObserver(Job job, Person person);
	abstract public boolean isInterviewObserver(Interview interview, Person person);
	abstract public JobStatusType findJobStatusType(String toStatusTypeCode, Domain toDomain);
	abstract public JobStatusReasonType findJobStatusReasonType(String reasonTypeCode, Domain toDomain);
	abstract public JobStatusTypeApprovalSet findJobStatusApprovals(Domain domain);
	abstract public Collection findJobStatusSetNeedingNotify(Domain domain);
	abstract public void updateJobStatus(JobStatus jobStatus);
	abstract public Collection findAllJobClassifications(Domain domain);
	abstract public JobClassification findJobClassification(String code);
	abstract public List findResumeScanBatchJobs(Job job);
	
	abstract public Collection findJobCandidateStatusReasonTypes(Domain domain, String fromStatusCode, String toStatusCode) ;
	abstract public JobCandidateStatusReasonType findDefaultCandidateStatusReason(Domain domain, 
			String fromStatusCode, String toStatusCode);
/**
 * Busca los Job de una compania.
 * @param company
 * @return Lista de Job.
 */
	abstract public List<Job> findJobs(Long idCompany);

	/**
	 * Devuelve la lista de job de una compania determinada, en el cual se puede postular una
	 * Persona.
	 * 
	 * @param id de Compania
	 * @return Lista de Jobs
	 */
	abstract public List<Job> findJobsForCandidate(Long idCompany, Long idPerson);

	/**
	 * Devuelve la lista de todos los Terms activos.
	 * 
	 * @return Lista de todos los Terms
	 */
	abstract public List<JobTerm> findAllJobTerm();

	/**
	 * Devuelve el Term al cual pertenece el codigo.
	 * 
	 * @param Codigo del Term
	 * @return  Term
	 */
	abstract public JobTerm findJobTermForCode(String termCode);

	/**
	 * Devuelve el Term segun el id pasado por parametro
	 * 
	 * @param Id del Term
	 * @return  Term
	 */
	abstract public JobTerm findJobTerm(Long idTerm);

	/**
	 * Guarda el term pasado por parametro.
	 * 
	 * @param Term
	 */
	abstract public void saveJobTerm(JobTerm term);

	/**
	 * Borra el term pasado por parametro.
	 * 
	 * @param Term
	 */
	abstract public void deleteJobTerm(Long idTerm);

	/**
	 * Guarda el function pasado por parametro.
	 * 
	 * @param Term
	 */
	abstract public void saveJobFunction(JobFunction function);

	
	/**
	 * Borra el Function pasado por parametro.
	 * 
	 * @param Function
	 */
	abstract public void deleteJobFunction(JobFunction function);

	/**
	 * Devuelve la lista de job de una compania determinada, en el cual la Persona este 
	 * Postulada como candidato y se pueda hacer entrevistas.
	 * 
	 * @param id de Compania
	 * @return Lista de Jobs
	 */
	abstract public List<Job> findJobsForInterview(Long idCompany, Long idPerson); 
	
	/**
	 * Devuelve todos los estados de un Job Order
	 * 
	 * @return Lista de todos los estados.
	 */

	abstract public List<JobStatusType> findJobStatus();
	
    /**
     * Devuelve la lista de job de una compania determinada
     * 
     * @param id de Compania
     * @return Lista de Jobs
     */
    abstract public List<Job> findJobsForCompany(Long idCompany);
    
    /**
     * Devuelve la lista de job de una compania determinada Excluye los job en estado cancelado y lleno
     * 
     * @param id de Compania
     * @return Lista de Jobs
     */
    abstract public List<Job> findJobsForCompanyExcludeFillAndCancelled(Long idCompany);

    /**
     * Devuelve la lista de CandidateInfo que usan 
     * @param id
     * @return
     */
    abstract public List<CandidateInfo> findCandidateInfoForResumeId(
			Long resumeId);
    
    /**
     * Devuelve todos los JobCandidate que utilizan el resume
     * @param id
     * @return Lista los JobCandidate que utilizan el resume
     */

    abstract public List<JobCandidate> findJobCandidateForResume(Long id);
    
}

